package factory.impl;

import Util.HandlerDefinition;
import factory.HandlerFactory;

public class WebAppHandlerFactory implements HandlerFactory {
    @Override
    public Object handler(HandlerDefinition definition) {
        Class<?> clazz = definition.getClazz();
        Object instance = null;
        try {
            instance = clazz.newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return instance;
    }
}
